import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.jzxiang.pickerview.TimePickerDialog
import com.jzxiang.pickerview.listener.OnDateSetListener

/**
 * @Author: whz
 * @Description:
 * @Date: create in 2021/4/23 16:41
 */
class DateTimePickDialogUtil:OnDateSetListener {

    private var dateTime:String?=null
    private var inputDate: TextView?=null
    private var mDialogAll:TimePickerDialog?=null
    private var dateSelected:OnDateSelected?=null
    private var tenYears:Long=10L*365*1000*60*60*24

    interface OnDateSelected{
        fun dateSelected(time:String)
    }

    fun setDateSelected(dateSelected:OnDateSelected){
        this.dateSelected=dateSelected
    }

    /**
     * 日期时间弹出选择框构造函数
     */
    constructor(activity:AppCompatActivity){
        if (mDialogAll==null){
            mDialogAll=TimePickerDialog.Builder()
                .apply {
                    setCallBack(this@DateTimePickDialogUtil)
                    setCancelStringId("取消")
                    setSureStringId("确定")

                }
                .setCallBack(this)

                .build()

        }
    }



    override fun onDateSet(timePickerView: TimePickerDialog?, millseconds: Long) {

    }
}